<!DOCTYPE html>
<meta charset="<?php bloginfo('charset'); ?>" />
<title><?php
	        global $page, $paged;
	
	        wp_title( ' &laquo; ', true, 'right' );
	
	        // Add the blog name
	        $site_name = get_bloginfo( 'name', 'display' );
		            echo "$site_name";
	
	        // Add the blog description for the home/front page
	        $site_description = get_bloginfo( 'description', 'display' );
	        if ( $site_description && ( is_home() || is_front_page() ) )
	                echo " - $site_description";
					
			// Add a page number if necessary:
			if ( $paged >= 2 || $page >= 2 )
				echo ' | ' . sprintf( __( 'Page %s', 'wpstrac' ), max( $paged, $page ) );

	        ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="icon" href="<?php bloginfo('template_url'); ?>/favicon.ico" type="image/x-icon" />
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/form_quicktags.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/math.js"></script>
<script type="text/javascript">
jQuery.validator.addMethod("notEqual", function(value, element, param) {
  return this.optional(element) || value !== param;
}, "Please choose a value!");

$(document).ready(function(){
	$("#new_ticket").validate({
		errorElement: "p",
		errorLabelContainer: $("#new_ticket div.error_box"),
		rules: { 
            ticket_title: "required",
            ticket_desc: "required",
			ticket_component: {
        		required: true,
       			notEqual: "-1"
    		},
			ticket_type: {
        		required: true,
       			notEqual: "-1"
    		},
			ticket_version: "required"
			<?php if ( !current_user_can('editor') ) { ?>,
			ticket_author: "required",
			math: "required",
            author_email: { 
                required: true,
                email: true
            } 
			<?php } ?>
        }, 
        messages: { 
            ticket_title: "Ange en titel för din rapport",
            ticket_desc: "Ange en beskrivning för din rapport",
			ticket_component: "Ange vilken komponent din rapport avser",
			ticket_type: "Ange vilken typ av fel du rapporterar",
			ticket_version: "Ange vilken version din rapport avser"
			<?php if ( !current_user_can('editor') ) { ?>,
			ticket_author: "Ett namn måste anges",
            math: "Du måste svara på antispamfrågan",
			author_email: { 
                required: "Du måste ange en e-postadress",
				email: "Ange en giltig e-postadress"
            } 
			<?php } ?>
        },
		submitHandler: function(form) {
   			form.submit();
 		}
	});
 
    $("#tracTable").tablesorter();
});
</script>
<?php
	if ( is_singular() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );

	wp_head();
?>
</head>
<body <?php body_class(); ?>>
<div id="trac-wrapper">
	<header id="logo"><a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/trac-logo.png" width="400" height="90" alt="WordPress Sverige | Trac" /></a></header>
    <section id="trac-breadcrumbs">
      <?php trac_breadcrumbs(); ?>
    </section>
